uniform sampler2D texture1;
varying vec3 normal;

void main () {
	vec4 color;
	vec3 light;
	float intensity = 0.0;
	int nb_Lights = 1;
	
	for (int i = 0; i < nb_Lights; i++) {
		light = gl_LightSource[i].position.xyz;
		intensity += 1.0 / nb_Lights * dot(light , normal);
	}
	
	if (intensity > 0.9) intensity = 0.9;
	else if (intensity > 0.5) intensity = 0.5;
	else if (intensity > 0.25) intensity = 0.25;
	else intensity = 0.1;
	
	gl_FragColor = intensity * texture2D (texture1, gl_TexCoord[0].st);;
}

